<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../../Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="../../Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="../../Css/style.css"/>
    <script type="text/javascript" src="../../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../../Js/ckform.js"></script>
    <script type="text/javascript" src="../../Js/common.js"></script>
    <script type="text/javascript" src="../../Js/ckeditor/ckeditor.js"></script>


    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
        $(function () {
            $('#backid').click(function () {
                window.location.href = "index.html";
            });

            loadData();
        });

        String.prototype.GetValue = function (para) {
            let reg = new RegExp("(^|&)" + para + "=([^&]*)(&|$)");
            let r = this.substr(this.indexOf("\?") + 1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        function loadData() {
            let url = document.location.toString();
            let drId = url.GetValue("drId");
            if (drId != null || drId != undefined && drId != "") {
                $.ajax({
                    url: `/drug/${drId}`,
                    type: "GET",
                    dataType: "json",
                    success: function (res) {
                        if (res.code == 200) {
                            let obj = res.obj;
                            $("#drId").html(obj.drId)
                            $("#drInprice").html(obj.drInprice);
                            $("#drOutprice").html(obj.drOutprice);
                            $("#drName").html(obj.drName);

                            let type = obj.drType;
                            let drType = "";
                            if (type == 1) {
                                drType = "处方药";
                            } else if (type == 2) {
                                drType = "中药";
                            } else if (type == 3) {
                                drType = "西药";
                            }
                            $("#drType").html(drType);

                            $("#drSimdesc").html(obj.drSimdesc);
                            $("#drTime").html(obj.drTime);
                            $("#drDetadesc").html(obj.drDetadesc);
                            $("#drFatory").html(obj.drFatory);
                            $("#drDirection").html(obj.drDirection);
                            $("#drRemark").html(obj.drRemark);
                        }
                    }
                })
            }
        }
    </script>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20">
    <table class="table table-bordered table-hover definewidth m10">
        <tr>
            <td width="10%" class="tableleft">药品编号</td>
            <td id="drId">J6764</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">图片</td>
            <!--            <td><img src="1.png"/></td>-->
            <td>暂无图片</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">进价</td>
            <td id="drInprice">2元</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">售价</td>
            <td id="drOutprice">128.9元</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">药品名称</td>
            <td id="drName">感冒药</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">药品类型</td>
            <td id="drType">处方药</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">简单描述</td>
            <td id="drSimdesc">用于普通感冒</td>
        </tr>

        <tr>
            <td width="10%" class="tableleft">过期日期</td>
            <td id="drTime">2016年01月01日</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">详细描述</td>
            <td id="drDetadesc">该药仅用于普通的流行性感冒,孕妇小孩慬用……</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">生产厂商</td>
            <td id="drFatory">哈药六厂生产</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">服用说明</td>
            <td id="drDirection">一次两粒一日三次</td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">库存</td>
            <td id="drNumber">3000袋</td>
        </tr>
        <!--<tr>
            <td width="10%" class="tableleft">剩余量</td>
            <td>1000袋</td>
        </tr>-->
        <tr>
            <td width="10%" class="tableleft">备注</td>
            <td id="drRemark">暂无服用后不良记录</td>
        </tr>
        <tr>
            <td colspan="2">
                <center>
                    <button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
                </center>
            </td>
        </tr>
    </table>
</form>
</body>
</html>